<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/sks/cms/page/share/taglib.jsp" %>
<html>
<head>
<title>外部员工显示</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="/css/vip.css" type="text/css">
<script language="JavaScript">
<!--
	//到指定的分页页面
	function topage(page){
		var form = document.forms[0];
		form.page.value=page;
		form.submit();
	}
function allSelect(){
	var form = document.forms[0];
	var state = form.allselectbox.checked;
	var length = form.userIds.length;
	if(length){
		for(var i=0;i<length;i++){
			form.userIds[i].checked=state;
		}
	}else{
		form.userIds.checked=state;
	}
}
function _action(methodName, status){
	if(selectItem()){
		var form = document.forms[0];
		form.action='<html:rewrite action="/cms/privilege/users/manage"/>?method='+ methodName+'&status='+status;
		form.submit();
	}else{
		alert("请选择要操作的记录");
	}
}
function selectItem(){
	var form = document.forms[0];
	var length = form.userIds.length;
	if(length){
		for(var i=0;i<length;i++){
			if(form.userIds[i].checked) return true;
		}
	}else{
		return form.userIds.checked;
	}
	return false;
}
function queryUsers() {
	document.forms[0].query.value = 'true';
	document.forms[0].submit();
}
function clearCondition() {
	document.forms[0].loginName.value = '';
	document.forms[0].query.value = 'false';
	document.forms[0].submit();
}
//-->
</script>
<SCRIPT language=JavaScript src="/js/FoshanRen.js"></SCRIPT>
</head>

<body bgcolor="#FFFFFF" text="#000000" marginwidth="0" marginheight="0">
<html:form action="/cms/privilege/users/list" method="post">
<html:hidden property="query" styleId="query"/>
<html:hidden property="method" value="list"/>
<html:hidden property="page"/>
  <table width="100%" border="0" cellspacing="1" cellpadding="2" align="center">
  
  	<tr bgcolor="f5f5f5"> 
      <td bgcolor="f5f5f5" colspan="7" align="center"><table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr> 
            <td width="12%" > <div align="right">用户名：</div></td>
      		<td width="78%"> 
      			<html:text property="loginName" size="30"/>
      		</td>
          </tr>
        </table>
      </td>
    </tr>
    
    <tr> 
      <td bgcolor="f5f5f5" colspan="7" align="center"><table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr> 
            <td width="5%"></td>
            <td width="95%">
              <button type="button" onClick="javascript:queryUsers();">&nbsp;<bean:message key="display.query"/>&nbsp;</button>&nbsp;&nbsp;
              <button type="button" onClick="javascript:clearCondition();">清除查询条件</button>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr ><td colspan="11" bgcolor="#ffbe26" align="right">
    	<%@ include file="/WEB-INF/page/share/fenye.jsp" %>
   </td></tr>
    <tr>
      <td width="8%" bgcolor="#ffbe26"> <div align="center"><font color="#000000">选择</font></div></td>
      <td width="5%" nowrap bgcolor="#ffbe26"> <div align="center"><font color="#000000">查看</font></div></td>
      <td width="10%" bgcolor="#ffbe26"> <div align="center"><font color="#000000">用户名</font></div></td>
      <td width="12%" bgcolor="#ffbe26"> <div align="center"><font color="#000000">联系电话</font></div></td>
      <td width="10%" bgcolor="#ffbe26"> <div align="center"><font color="#000000">电子邮件</font></div></td>
      <td width="7%" bgcolor="#ffbe26"> <div align="center"><font color="#000000">状态</font></div></td>
      <td width="9%" bgcolor="#ffbe26"></td>
    </tr>
<!---------------------------LOOP START------------------------------>
<c:forEach items="${pageView.records}" var="entry">
    <tr>
      <td bgcolor="f5f5f5"> <div align="center"><input type="checkbox" name="userIds" value="${entry.userId}"></div></td>
      <td bgcolor="f5f5f5" width="5%"> <div align="center"><a href="<html:rewrite action="/cms/privilege/users/manage"/>?method=editUsersUI&userId=${entry.userId}">
	  <img src="/images/edit.gif" width="15" height="16" border="0"></a></div></td>
      <td bgcolor="f5f5f5"> <div align="center">${entry.loginName}</div></td>
      <td bgcolor="f5f5f5"> <div align="center">${entry.mobile}</div></td>
      <td bgcolor="f5f5f5"> <div align="center">${entry.email}</div></td>
      <td bgcolor="f5f5f5"> <div align="center"><c:if test="${entry.status}">可用</c:if><c:if test="${!entry.status}">禁用</c:if></div></td>
      <td bgcolor="f5f5f5"> <div align="center">
      <a href="<html:rewrite action="/cms/privilege/users/manage"/>?method=delete&userId=${entry.userId}">删除该用户</a>
      </div></td>
	</tr>
</c:forEach>
    <!----------------------LOOP END------------------------------->
    <tr> 
      <td bgcolor="f5f5f5" colspan="11" align="center"><table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr> 
            <td width="5%"></td>
              <td width="10%"><input type="checkbox" onclick="javascript:allSelect()" name="allselectbox">全选</td>
              <td width="85%">
<%-- <input type="button" class="frm_btn" onClick="javascript:window.location.href='<html:rewrite action="/cms/privilege/users/manage"/>?method=regUsersUI'" value="添加员工"> &nbsp;&nbsp; --%>
<input type="button" value=" 禁 用 " class="frm_btn" onclick="javascript:_action('enable', false)">&nbsp;&nbsp;
<input type="button" value=" 启 用 " class="frm_btn" onclick="javascript:_action('enable', true)">
            </td>
          </tr>
        </table></td>
    </tr>
  </table>
</html:form>
</body>
</html>